/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.ProjetoFinal.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author DCBorges
 */
@Entity
@Table(name = "sdctb014_rais_mda")
public class RaisMedia implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_SQNCL_RAIS")
    private Integer nuSqnclRais;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_CNPJ_EMPREGADOR")
    private long nuCnpjEmpregador;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "VR_RMNRCO_MEDIA")
    private BigDecimal vrRmnrcoMedia;
    @JoinColumns({
        @JoinColumn(name = "NU_SNQCL_GRPO_FMLR", referencedColumnName = "NU_SNQCL_GRPO_FMLR"),
        @JoinColumn(name = "NU_SQNCL_PRTE", referencedColumnName = "NU_SQNCL_PRTE")})
    @ManyToOne(optional = false)
    private ParticipanteGrupo participanteGrupo;

    public RaisMedia() {
    }

    public RaisMedia(Integer nuSqnclRais) {
        this.nuSqnclRais = nuSqnclRais;
    }

    public RaisMedia(Integer nuSqnclRais, long nuCnpjEmpregador, BigDecimal vrRmnrcoMedia) {
        this.nuSqnclRais = nuSqnclRais;
        this.nuCnpjEmpregador = nuCnpjEmpregador;
        this.vrRmnrcoMedia = vrRmnrcoMedia;
    }

    public Integer getNuSqnclRais() {
        return nuSqnclRais;
    }

    public void setNuSqnclRais(Integer nuSqnclRais) {
        this.nuSqnclRais = nuSqnclRais;
    }

    public long getNuCnpjEmpregador() {
        return nuCnpjEmpregador;
    }

    public void setNuCnpjEmpregador(long nuCnpjEmpregador) {
        this.nuCnpjEmpregador = nuCnpjEmpregador;
    }

    public BigDecimal getVrRmnrcoMedia() {
        return vrRmnrcoMedia;
    }

    public void setVrRmnrcoMedia(BigDecimal vrRmnrcoMedia) {
        this.vrRmnrcoMedia = vrRmnrcoMedia;
    }

    public ParticipanteGrupo getParticipanteGrupo() {
        return participanteGrupo;
    }

    public void setParticipanteGrupo(ParticipanteGrupo participanteGrupo) {
        this.participanteGrupo = participanteGrupo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nuSqnclRais != null ? nuSqnclRais.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RaisMedia)) {
            return false;
        }
        RaisMedia other = (RaisMedia) object;
        if ((this.nuSqnclRais == null && other.nuSqnclRais != null) || (this.nuSqnclRais != null && !this.nuSqnclRais.equals(other.nuSqnclRais))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.ProjetoFinal.domain.RaisMedia[ nuSqnclRais=" + nuSqnclRais + " ]";
    }
    
}
